﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- Brush for the background of the different windows -->
	<LinearGradientBrush x:Key="WindowBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#1F1F1F" Offset="0" />
		<GradientStop Color="#333333" Offset="0.46" />
		<GradientStop Color="#444444" Offset="0.49" />
		<GradientStop Color="#999999" Offset="0.5" />
		<GradientStop Color="#444444" Offset="0.51" />
		<GradientStop Color="#333333" Offset="0.54" />
		<GradientStop Color="#1F1F1F" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="StatusbarBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#454545" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="ControlPanelHeaderBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#454545" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="0.5" />
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="TopbarBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#1F1F1F" Offset="0" />
		<GradientStop Color="#454545" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="MenuBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#F6F6F6" Offset="0" />
		<GradientStop Color="#E1E1E1" Offset="0.4" />
		<GradientStop Color="#E1E1E1" Offset="0.7" />
		<GradientStop Color="#FBFBFB" Offset="1" />
	</LinearGradientBrush>
		
	<LinearGradientBrush x:Key="ChartBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#454545" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="0.03" />
		<GradientStop Color="#1F1F1F" Offset="0.97" />
		<GradientStop Color="#454545" Offset="1" />
	</LinearGradientBrush>		
		
	<LinearGradientBrush x:Key="DownbarBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#1F1F1F" Offset="0" />
		<GradientStop Color="#454545" Offset="1" />
	</LinearGradientBrush>
	
	<!-- Color for the font used at most places -->
	<SolidColorBrush x:Key="FontBrush" Color="#CCCCCC" />

	<SolidColorBrush x:Key="SelectedRowBrush" Color="#444444"/>

	<SolidColorBrush x:Key="GridBackground" Color="#1F1F1F" />

	<SolidColorBrush x:Key="BorderLine" Color="#688CAF" />

	<SolidColorBrush x:Key="ResultLines" Color="#888888"/>

	<SolidColorBrush x:Key="ControlPanelLines" Color="#888888"/>
	
	<LinearGradientBrush x:Key="HistoricalPluginViewerBackground" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#454545" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="0.05" />
	</LinearGradientBrush>
	
	<!-- Color for the good values -->
	<SolidColorBrush x:Shared="False" x:Key="GreenSmooth" Color="#59BF59" />
	<SolidColorBrush x:Shared="False" x:Key="GreenHighlightedBrush" Color="#BFFF55" />
	<SolidColorBrush x:Shared="False" x:Key="GreenBrush" Color="#8CF211" />
	<SolidColorBrush x:Shared="False" x:Key="GreenInsideBrush" Color="#004400" />
	<LinearGradientBrush x:Shared="False" x:Key="GreenGradient" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#004400" Offset="1" />
		<GradientStop Color="#8CF211" Offset="0" />
	</LinearGradientBrush>
	
	<!-- Color for the bad values -->
	<SolidColorBrush x:Shared="False" x:Key="RedSmooth" Color="#BC5858" />
	<SolidColorBrush x:Shared="False" x:Key="RedHighlightedBrush" Color="#FF5555" />
	<SolidColorBrush x:Shared="False" x:Key="RedBrush" Color="#FF2222" />
	<SolidColorBrush x:Shared="False" x:Key="RedInsideBrush" Color="#440000"  />
	<LinearGradientBrush x:Shared="False" x:Key="RedGradient" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#440000" Offset="1" />
		<GradientStop Color="#FF2222" Offset="0" />
	</LinearGradientBrush>

	<!-- Color for the medium values -->
	<SolidColorBrush x:Shared="False" x:Key="YellowBrush" Color="#FFFF22"/>
	<SolidColorBrush x:Shared="False" x:Key="YellowInsideBrush" Color="#444400"/>
	<LinearGradientBrush x:Shared="False" x:Key="YellowGradient" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#444400" Offset="1" />
		<GradientStop Color="#FFFF22" Offset="0" />
	</LinearGradientBrush>
	
	<!-- Style that set the default values of the application (not common to all the applications) -->
	<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Style.Triggers>
            <Trigger Property="TextBlock.IsEnabled" Value="False" >
                <Setter Property="TextBlock.Opacity" Value="0.5" />
            </Trigger>
        </Style.Triggers>
        <Setter Property="Foreground" Value="{StaticResource FontBrush}" />
	</Style>

	<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource {x:Type GroupBox}}">
		<Setter Property="Foreground" Value="{StaticResource FontBrush}" />
	</Style>

	<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
		<Setter Property="Foreground" Value="{StaticResource FontBrush}" />
	</Style>

	<Style TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Type RadioButton}}">
		<Setter Property="Foreground" Value="{StaticResource FontBrush}" />
	</Style>
	
	<Style TargetType="{x:Type DataGridCell}" x:Key="CellSelectionStyle">
		<Style.Triggers>
			<Trigger Property="DataGridCell.IsSelected" Value="True">
				<Setter Property="Background" Value="{StaticResource SelectedRowBrush}" />
				<Setter Property="BorderBrush" Value="Black" />
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<!-- DataGrid settings -->
	<LinearGradientBrush x:Key="DataGridHeaderBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#565656" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="1" />
	</LinearGradientBrush>

	<SolidColorBrush x:Key="DataGridHeaderBorderBrush" Color="#393939" />

	<LinearGradientBrush x:Key="DataGridHeaderHighLightedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#898989" Offset="0" />
		<GradientStop Color="#1F1F1F" Offset="1" />
	</LinearGradientBrush>

	<Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
		<Setter Property="Width" Value="8"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Cursor" Value="SizeWE"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type DataGridColumnHeader}" x:Key="DataGridColumnHeaderRight">
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="MinWidth" Value="0" />
		<Setter Property="MinHeight" Value="28" />
		<Setter Property="Foreground" Value="#CCCCCC" />
		<Setter Property="Cursor" Value="Hand" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Border x:Name="BackgroundBorder" BorderThickness="0,0,0,0" Background="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" BorderBrush="{StaticResource DataGridHeaderBorderBrush}" Grid.ColumnSpan="2" />

						<ContentPresenter Margin="6,3,6,3" VerticalAlignment="Center" HorizontalAlignment="Right" />

						<Polygon x:Name="SortArrow" Visibility="Collapsed" Grid.Column="1" Points="0,0 5,0 2.5,5" Stroke="White" Fill="White" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Width="6" Height="6" Margin="0,2,8,0" VerticalAlignment="Center"/>

						<Rectangle Width="1" Fill="{StaticResource DataGridHeaderBorderBrush}" HorizontalAlignment="Right" Grid.ColumnSpan="2" />
						<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/>
						<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/>
					</Grid>

					<ControlTemplate.Triggers>
						<Trigger Property="SortDirection" Value="{x:Null}">
							<Setter TargetName="BackgroundBorder" Property="Background" Value="{DynamicResource DataGridHeaderBackgroundBrush}" />
							<Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="Transparent" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True" />
								<Condition Property="SortDirection" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="BackgroundBorder" Value="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" />
							<Setter Property="BorderBrush" TargetName="BackgroundBorder" Value="{StaticResource DataGridHeaderBorderBrush}" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True" />
								<Condition Property="SortDirection" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter TargetName="BackgroundBorder" Property="Background" Value="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" />
							<Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="{StaticResource DataGridHeaderBorderBrush}" />
						</MultiTrigger>

						<Trigger Property="SortDirection" Value="Ascending">
							<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
							<Setter TargetName="SortArrow" Property="RenderTransform">
								<Setter.Value>
									<RotateTransform Angle="180" />
								</Setter.Value>
							</Setter>
						</Trigger>
						<Trigger Property="SortDirection" Value="Descending">
							<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
						</Trigger>
						<Trigger Property="DisplayIndex" Value="0">
							<Setter Property="Visibility" Value="Collapsed" TargetName="PART_LeftHeaderGripper"></Setter>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type DataGridColumnHeader}" x:Key="DataGridColumnHeaderLeft">
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="MinWidth" Value="0" />
		<Setter Property="MinHeight" Value="28" />
		<Setter Property="Foreground" Value="#CCCCCC" />
		<Setter Property="Cursor" Value="Hand" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Border x:Name="BackgroundBorder" BorderThickness="0,0,0,0" Background="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" BorderBrush="{StaticResource DataGridHeaderBorderBrush}" Grid.ColumnSpan="2" />

						<ContentPresenter Margin="6,3,6,3" VerticalAlignment="Center" HorizontalAlignment="Left" />

						<Polygon x:Name="SortArrow" Visibility="Collapsed" Grid.Column="1" Points="0,0 5,0 2.5,5" Stroke="White" Fill="White" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Width="6" Height="6" Margin="0,2,8,0" VerticalAlignment="Center"/>

						<Rectangle Width="1" Fill="{StaticResource DataGridHeaderBorderBrush}" HorizontalAlignment="Right" Grid.ColumnSpan="2" />
						<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/>
						<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/>
					</Grid>

					<ControlTemplate.Triggers>
						<Trigger Property="SortDirection" Value="{x:Null}">
							<Setter TargetName="BackgroundBorder" Property="Background" Value="{DynamicResource DataGridHeaderBackgroundBrush}" />
							<Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="Transparent" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True" />
								<Condition Property="SortDirection" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="BackgroundBorder" Value="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" />
							<Setter Property="BorderBrush" TargetName="BackgroundBorder" Value="{StaticResource DataGridHeaderBorderBrush}" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True" />
								<Condition Property="SortDirection" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter TargetName="BackgroundBorder" Property="Background" Value="{StaticResource DataGridHeaderHighLightedBackgroundBrush}" />
							<Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="{StaticResource DataGridHeaderBorderBrush}" />
						</MultiTrigger>

						<Trigger Property="SortDirection" Value="Ascending">
							<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
							<Setter TargetName="SortArrow" Property="RenderTransform">
								<Setter.Value>
									<RotateTransform Angle="180" />
								</Setter.Value>
							</Setter>
						</Trigger>
						<Trigger Property="SortDirection" Value="Descending">
							<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
						</Trigger>
						<Trigger Property="DisplayIndex" Value="0">
							<Setter Property="Visibility" Value="Collapsed" TargetName="PART_LeftHeaderGripper"></Setter>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Expander ControlTemplate -->
	<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid Background="Transparent" SnapsToDevicePixels="False">
							<Grid.RowDefinitions>
								<RowDefinition Height="19"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid>
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="-90"/>
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
								<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
							</Grid>
							<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
							<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid Background="Transparent" SnapsToDevicePixels="False">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<Grid>
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="180"/>
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
								<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
							</Grid>
							<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
							<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid Background="Transparent" SnapsToDevicePixels="False">
							<Grid.RowDefinitions>
								<RowDefinition Height="19"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid>
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="90"/>
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
								<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
							</Grid>
							<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
							<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderHeaderFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Border>
						<Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}" BorderThickness="1" BorderBrush="Black" CornerRadius="10,10,0,0" >
						<Grid Background="Transparent" SnapsToDevicePixels="False">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="19"/>
							</Grid.ColumnDefinitions>
							<Ellipse Grid.Column="1" x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
							<Path Grid.Column="1" x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
							<ContentPresenter HorizontalAlignment="Center" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
							<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
							<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="Expander" x:Key="{x:Type Expander}">
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Expander}">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true">
						<DockPanel>
							<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="0" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
							<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</DockPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="true">
							<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Right">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Up">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Left">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	
	<Style TargetType="TextBox" x:Key="TextBoxReadonly">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource FontBrush}" />
		<Setter Property="BorderBrush" Value="White"/>
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="IsReadOnly" Value="True" />
		<Setter Property="IsHitTestVisible" Value="False" />
		<Setter Property="IsManipulationEnabled" Value="False" />
		<Setter Property="IsUndoEnabled" Value="False" />
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="TextBox">
					<Border Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"  Background="{TemplateBinding Background}"  SnapsToDevicePixels="true">
						<ScrollViewer Name="PART_ContentHost" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Value="Transparent" Property="Background" />
							<Setter Value="{StaticResource FontBrush}" Property="Foreground" />
							<Setter TargetName="PART_ContentHost" Property="Background" Value="Transparent"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
<!-- All the following is required to Re-Style the ScrollViewer, see 
             http://msdn2.microsoft.com/en-us/library/aa970847(VS.85).aspx
             http://msdn2.microsoft.com/en-us/library/ms742173(VS.85).aspx
             for the default Stles that the ScrollViewer has out of the box
         -->

	<!-- Brushes used in Styling of ScrollViewer -->
	<SolidColorBrush x:Key="StandardBorderBrush" Color="#888" />
	<SolidColorBrush x:Key="StandardBackgroundBrush" Color="#888" />
	<SolidColorBrush x:Key="HoverBorderBrush" Color="#DDD" />
	<SolidColorBrush x:Key="SelectedBackgroundBrush" Color="Gray" />
	<SolidColorBrush x:Key="SelectedForegroundBrush" Color="White" />
	<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
	<SolidColorBrush x:Key="NormalBrush" Color="#444" />
	<SolidColorBrush x:Key="NormalBorderBrush" Color="#888" />
	<SolidColorBrush x:Key="HorizontalNormalBrush" Color="#444" />
	<SolidColorBrush x:Key="HorizontalNormalBorderBrush" Color="#888" />
	<LinearGradientBrush x:Key="ListBoxBackgroundBrush" 
			StartPoint="0,0" EndPoint="1,0.001">
		<GradientBrush.GradientStops>
			<GradientStopCollection>
				<GradientStop Color="White" Offset="0.0" />
				<GradientStop Color="White" Offset="0.6" />
				<GradientStop Color="#DDDDDD" Offset="1.2"/>
			</GradientStopCollection>
		</GradientBrush.GradientStops>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="StandardBrush" 
			StartPoint="0,0" EndPoint="0,1">
		<GradientBrush.GradientStops>
			<GradientStopCollection>
				<GradientStop Color="#FFF" Offset="0.0"/>
				<GradientStop Color="#CCC" Offset="1.0"/>
			</GradientStopCollection>
		</GradientBrush.GradientStops>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="GlyphBrush" Color="#DDD" />
	<LinearGradientBrush x:Key="PressedBrush" 
			StartPoint="0,0" EndPoint="0,1">
		<GradientBrush.GradientStops>
			<GradientStopCollection>
				<GradientStop Color="#BBB" Offset="0.0"/>
				<GradientStop Color="#EEE" Offset="0.1"/>
				<GradientStop Color="#EEE" Offset="0.9"/>
				<GradientStop Color="#FFF" Offset="1.0"/>
			</GradientStopCollection>
		</GradientBrush.GradientStops>
	</LinearGradientBrush>

	<!-- SrollViewer ScrollBar Repeat Buttons (at each end) -->
	<Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Border Name="Border" Margin="1" CornerRadius="2" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1">
						<Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource GlyphBrush}" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsPressed" Value="true">
							<Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- SrollViewer ScrollBar Repeat Buttons (The part in the middle, not the thumb the long area between the buttons ) -->
	<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Border Background="Transparent" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- ScrollViewer ScrollBar Thumb, that part that can be dragged up/down or left/right Buttons -->
	<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
		<Grid >
			<Grid.RowDefinitions>
				<RowDefinition MaxHeight="18"/>
				<RowDefinition Height="0.00001*"/>
				<RowDefinition MaxHeight="18"/>
			</Grid.RowDefinitions>
			<Border Grid.RowSpan="3" CornerRadius="2" Background="{StaticResource ResultLines}" />
			<RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
			<Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
				<Track.DecreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="{StaticResource HorizontalNormalBrush}" BorderBrush="{StaticResource HorizontalNormalBorderBrush}" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
				</Track.IncreaseRepeatButton>
			</Track>
			<RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z"/>
		</Grid>
	</ControlTemplate>

	<!-- HorizontalScrollBar Template using the previously created Templates -->
	<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
		<Grid >
			<Grid.ColumnDefinitions>
				<ColumnDefinition MaxWidth="18"/>
				<ColumnDefinition Width="0.00001*"/>
				<ColumnDefinition MaxWidth="18"/>
			</Grid.ColumnDefinitions>
			<Border Grid.ColumnSpan="3" CornerRadius="2" Background="{StaticResource ResultLines}" />
			<RepeatButton Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
			<Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
				<Track.DecreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,1,0,1" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource NormalBorderBrush}" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
				</Track.IncreaseRepeatButton>
			</Track>
			<RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z"/>
		</Grid>
	</ControlTemplate>

	<!-- Style for overall  ScrollBar -->
	<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Style.Triggers>
			<Trigger Property="Orientation" Value="Horizontal">
				<Setter Property="Width" Value="Auto"/>
				<Setter Property="Height" Value="18" />
				<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
			</Trigger>
			<Trigger Property="Orientation" Value="Vertical">
				<Setter Property="Width" Value="18"/>
				<Setter Property="Height" Value="Auto" />
				<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<!-- Style for overall  ScrollViewer -->
	<Style x:Key="FavsScrollViewer" TargetType="{x:Type ScrollViewer}">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ScrollViewer}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>

						<ScrollContentPresenter Grid.Column="1"/>

						<ScrollBar Name="PART_VerticalScrollBar" Value="{TemplateBinding VerticalOffset}" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
						<ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Value="{TemplateBinding HorizontalOffset}" Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
